package com.twu.bean;

public class Movie
{

	public static final String SPACE_MARKER = "    ";
	public static final String NULL_RATING = "N/A";

	private final String name;
	private final String year;
	private final String director;
	private final String rating;

	public Movie(String name, String year, String director, String rating)
	{
		this.name = name;
		this.year = year;
		this.director = director;
		this.rating = rating;
	}

	@Override
	public String toString()
	{
		return new StringBuilder().append(name).append(SPACE_MARKER).append(year).append(SPACE_MARKER).append(director).append(
				SPACE_MARKER).append(getRating()).toString();
	}

	private String getRating()
	{
		return rating == null ? NULL_RATING : rating;
	}
}
